<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: Calibration routines</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">1.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Calibration routines</div>  </div>
<div class="ingroups"><a class="el" href="group__nav__eq.html">OpenShoe filtering algorithms</a></div></div>
<div class="contents">

<p>Calibration routines. Only accelerometer calibration is implemented since basic gyro calibration (bias) is trivial and is available on the IMU.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__calib.html#ga272f4012a72ac416888be28bff0236e6">estimate_accelerometer_biases</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function that estimates the accelerometer biases given a matrix of the mean of the measured acceleration at different orientations.  <a href="#ga272f4012a72ac416888be28bff0236e6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__calib.html#gabb3f28a44a35898c77d789734914c4c2">calibrate_accelerometers</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for calibrating the accelerometer biases.  <a href="#gabb3f28a44a35898c77d789734914c4c2"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Calibration routines. Only accelerometer calibration is implemented since basic gyro calibration (bias) is trivial and is available on the IMU. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gabb3f28a44a35898c77d789734914c4c2"></a><!-- doxytag: member="nav_eq.c::calibrate_accelerometers" ref="gabb3f28a44a35898c77d789734914c4c2" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void calibrate_accelerometers </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function for calibrating the accelerometer biases. </p>
<p>This function is used to calibrate the biases of the accelerometers in the IMU and requires the users to place the IMU into at least three different orientations. The calibration method is based upon the calibration algorithm described in the paper <a href="https://eeweb01.ee.kth.se/upload/publications/reports/2010/IR-EE-SB_2010_046.pdf">Calibration of the Accelerometer Triad of an Inertial Measurement Unit, Maximum Likelihood Estimation and Cramer-Rao Bound</a>, but does only calibrate the accelerometer bias.</p>
<p>Before the calibration is started the flags <em>new_orientation_flag</em> and <em>acc_calibration_successful_flag</em> should be set to false. Then the function should called every time new IMU-data have been read from the IMU and as long as the new flags <em>new_orientation_flag</em> and <em>acc_calibration_successful_flag</em> are false. When the flag <em>new_orientation_flag</em> becomes true a message should be sent to the user, which then should place the IMU in a new orientation and reset the flag. When the flag <em>acc_calibration_successful_flag</em> becomes true the calibration is finished and the accelerometer calibration parameters have been written into the memory of the IMU.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The function can return one error and one warning message that are stored in the variable #error_vec. The error message may be sent if the was no stationary during one of the calibration phases and new accelerometer data most be recorded with the IMU in the same orientation. A warning message may be sent if the orientations the IMU was placed in may have caused a poor estimate of the accelerometer biases.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">error_vec</td><td>A variable that is set non zero value of an error/warning has occurred during the </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">acc_calibration_successful_flag</td><td>A flag that should be false when calibration is started and that becomes true when the calibration is finished. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">new_orientation_flag</td><td>A flag that should be false when calibration is started and that becomes true when IMU should be placed in a new orientation. When the IMU has been placed in a new orientation it should be set to false. execution of the function. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">accelerations_in</td><td>The from the IMU latest read acceleration data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga272f4012a72ac416888be28bff0236e6"></a><!-- doxytag: member="nav_eq.c::estimate_accelerometer_biases" ref="ga272f4012a72ac416888be28bff0236e6" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void estimate_accelerometer_biases </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Function that estimates the accelerometer biases given a matrix of the mean of the measured acceleration at different orientations. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">max_v</td><td>Largest value of the input vector. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">index</td><td>Index of the vector element holding the largest value. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">arg_vec</td><td>The input vector. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Dec 20 2011 12:12:37 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
